% This is a MATLAB 'Script'

% You can run this file by typing 'Jan_12' on the command line, which would
% be equivalent to typing in each line into the command line manually

%% The double '%' makes a block of code in the editor.   
% use cntr-enter to run the higlighted block

% Some simple arithmetic

% You can type this on the command line 

2+2

% or highlight with mouse and press F9, 

% or run whole block with cntr-enter


%%  Some simple variable assignment

a=4     %you can put comments like this as well
b=a+a

%notice the data type in the 'Workspace' window. 

%% Some 'for' loops

% count up to (including) 10

for ii=1:10
    ii 
end

%need extra help on 'for'? 

%use 
help for

%or 

doc for

% go backward from 10 in increments of -0.1
for ii=10:-.1:0
    ii 
end


%% A while loop

jj=0    %remember the intialization!
while jj<10
  jj=jj+1  
end

% you can break out of infinite loops with cntr-c
kk=0
while 1==1
  kk=kk+1  
end

%% Other helpfull commands:

%clear command window:
clc

%clear variables:
clear






